package data.nanjing.expo.services;

import data.nanjing.expo.models.dao.TradeRequireDao;
import data.nanjing.expo.models.domain.TradeRequire;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by zjp on 2018/6/26.
 * QQ：34948062
 * github: https://www.github.com/zjp1029
 * web： http://www.zjp1029.cn
 */
@Service
public class TradeRequireService {

    @Autowired
    private TradeRequireDao requireDao;

    //查询首页的热门活动，是由管理员设定的
    public List<TradeRequire> selectHotRequireList() {
        return requireDao.selectHotRequires();
    }

    //根据id查询需求详情
    public TradeRequire selectRequireById(Integer id) {
        return requireDao.selectRequireById(id);
    }

    //发布需求
    public void addTradeRequire(TradeRequire require){
        requireDao.addTradeRequire(require);
    }

}
